import request from '@/utils/request'
//属性管理
//查
export const reqGetAttrCategory1 = () => request.get(`/admin/product/getCategory1`)
export const reqGetAttrCategory2 = category1Id =>
  request.get(`/admin/product/getCategory2/${category1Id}`)
export const reqGetAttrCategory3 = category2Id =>
  request.get(`/admin/product/getCategory3/${category2Id}`)
export const reqGetAttrInfoList = (category1Id, category2Id, category3Id) =>
  request.get(`/admin/product/attrInfoList/${category1Id}/${category2Id}/${category3Id}`)
//添加或修改attr  传id修改，不传id添加
export const reqAttrsaveAttrInfo = obj => {
  return request.post(`/admin/product/saveAttrInfo`, obj)
}
// {
//   "attrName": "string",
//   "attrValueList": [
//     {
//       "attrId": 0,
//       "id": 0,
//       "valueName": "string"
//     }
//   ],
//   "categoryId": 0,
//   "categoryLevel": 0,
//   "id": 0
// }
export const reqdeleteAttr = attrId => request.delete(`/admin/product/deleteAttr/${attrId}`)
